<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Aestate: aestate/work/Cache.py Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Aestate
   &#160;<span id="projectnumber">1.0.5</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_374ee6e3281d8312d956f1f155302869.html">aestate</a></li><li class="navelem"><a class="el" href="dir_5abfa80149f37441c1f61fb6211d8f7d.html">work</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Cache.py</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_cache_8py.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"><a class="line" href="namespaceaestate_1_1work_1_1_cache.html">    1</a></span>&#160;<span class="comment"># -*- utf-8 -*-</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="keyword">import</span> math</div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="keyword">import</span> os</div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="keyword">import</span> threading</div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="keyword">import</span> time</div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="keyword">from</span> collections <span class="keyword">import</span> OrderedDict</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="keyword">from</span> enum <span class="keyword">import</span> Enum</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="keyword">from</span> typing <span class="keyword">import</span> List</div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160; </div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="keyword">import</span> psutil</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160; </div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="keyword">from</span> <a class="code" href="namespaceaestate_1_1exception.html">aestate.exception</a> <span class="keyword">import</span> LogStatus</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="keyword">from</span> <a class="code" href="namespaceaestate_1_1util.html">aestate.util</a> <span class="keyword">import</span> others</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="keyword">from</span> <a class="code" href="namespaceaestate_1_1util_1_1others.html">aestate.util.others</a> <span class="keyword">import</span> write</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="keyword">from</span> <a class="code" href="namespaceaestate_1_1work_1_1_modes.html">aestate.work.Modes</a> <span class="keyword">import</span> Singleton</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160; </div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="stringliteral">&quot;&quot;&quot;</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="stringliteral">全世界无产者,联合起来!!!</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="stringliteral">我们要强烈抵制资本主义的剥削!!!</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="stringliteral">&quot;&quot;&quot;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160; </div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160; </div>
<div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_cache_status.html">   23</a></span>&#160;<span class="keyword">class </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_cache_status.html">CacheStatus</a>(Enum):</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;    <span class="stringliteral">&quot;&quot;&quot;</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="stringliteral">    缓存的状态</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="stringliteral">    &quot;&quot;&quot;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_cache_status.html#a40345d9a7a21fe9ac559a130a6098891">   27</a></span>&#160;    CLOSE = 0</div>
<div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_cache_status.html#a86d2e90090af5f86ddb0fa2426c9e264">   28</a></span>&#160;    OPEN = 1</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160; </div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160; </div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html">   31</a></span>&#160;<span class="keyword">class </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html">SqlCacheItem</a>(object):</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    <span class="stringliteral">&quot;&quot;&quot;缓存对象&quot;&quot;&quot;</span></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160; </div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a2c6fb792c720aa8d6514fdc851059c03">   34</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a2c6fb792c720aa8d6514fdc851059c03">__init__</a>(self, key, value, instance):</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;        <span class="comment"># 执行的sql</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#acd5325286ebd500b0d76755ca6d49da0">   36</a></span>&#160;        self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#acd5325286ebd500b0d76755ca6d49da0">sql</a> = key</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;        <span class="comment"># 数据</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a35298c7944cbf476773dfbd52e4bf5c2">   38</a></span>&#160;        self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a35298c7944cbf476773dfbd52e4bf5c2">data</a> = value</div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a91cb519f7b12df4536efca91b6d565f2">   39</a></span>&#160;        self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a91cb519f7b12df4536efca91b6d565f2">instance</a> = instance</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;        <span class="comment"># 使用次数</span></div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a31329fa5d5f09dff8780705b10722f53">   41</a></span>&#160;        self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a31329fa5d5f09dff8780705b10722f53">using_count</a> = 0</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;        <span class="comment"># 写入的时间</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a75156126f63060127a15dd207bd9e42b">   43</a></span>&#160;        self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a75156126f63060127a15dd207bd9e42b">create_time</a> = time.time()</div>
<div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a8dd56f8f9eed40096c364f764439cf4f">   44</a></span>&#160;        self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a8dd56f8f9eed40096c364f764439cf4f">last_using_time</a> = time.time()</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;        super(SqlCacheItem, self).<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a2c6fb792c720aa8d6514fdc851059c03">__init__</a>()</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160; </div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#ac9f7861a146addf7776e3dd7e9e1a40d">   47</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#ac9f7861a146addf7776e3dd7e9e1a40d">__setattr__</a>(self, key, value):</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;        <span class="keywordflow">if</span> key == <span class="stringliteral">&#39;using_count&#39;</span>:</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;            self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a8dd56f8f9eed40096c364f764439cf4f">last_using_time</a> = time.time()</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;        super(SqlCacheItem, self).<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#ac9f7861a146addf7776e3dd7e9e1a40d">__setattr__</a>(key, value)</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160; </div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#adf51da4c5530916e92836fae2d3a411f">   52</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#adf51da4c5530916e92836fae2d3a411f">set_using_count</a>(self):</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;        self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a31329fa5d5f09dff8780705b10722f53">using_count</a> += 1</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160; </div>
<div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a708bfff78dc5c694bd280406b035dc83">   55</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a708bfff78dc5c694bd280406b035dc83">get_sql</a>(self):</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;        <span class="keywordflow">return</span> self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#acd5325286ebd500b0d76755ca6d49da0">sql</a></div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160; </div>
<div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a3005829b325cf3817b9e77188df7cd5c">   58</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a3005829b325cf3817b9e77188df7cd5c">get_value</a>(self):</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;        <span class="keywordflow">return</span> self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a35298c7944cbf476773dfbd52e4bf5c2">data</a></div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160; </div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160; </div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_data_container.html">   62</a></span>&#160;<span class="keyword">class </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_data_container.html">DataContainer</a>(List[SqlCacheItem]):</div>
<div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_data_container.html#a15cb8f5eb2bacb4ca779ebec72bf4997">   63</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_data_container.html#a15cb8f5eb2bacb4ca779ebec72bf4997">__init__</a>(self):</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;        list.__init__([])</div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_data_container.html#aa50fe7a984158c7b7102a0085bd2794a">   65</a></span>&#160;        self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_data_container.html#aa50fe7a984158c7b7102a0085bd2794a">data_dict</a> = {}</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160; </div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_data_container.html#a2c9f06012341409fd486408a21a25f07">   67</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_data_container.html#a2c9f06012341409fd486408a21a25f07">__sizeof__</a>(self):</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;        <span class="keywordflow">return</span> sum(i.__sizeof__() <span class="keywordflow">for</span> i <span class="keywordflow">in</span> self)</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160; </div>
<div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_data_container.html#ade9b9ec835a75364f390c838b0f2df32">   70</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_data_container.html#ade9b9ec835a75364f390c838b0f2df32">delete</a>(self, tb_name):</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;        temp_array = []</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;        <span class="keywordflow">for</span> i, item <span class="keywordflow">in</span> enumerate(self):</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;            <span class="keywordflow">if</span> hasattr(item, <span class="stringliteral">&#39;instance&#39;</span>) <span class="keywordflow">and</span> item.instance.get_tb_name() == tb_name:</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;                temp_array.append(i)</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;            <span class="keywordflow">elif</span> item.instance.get_tb_name() == tb_name:</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;                temp_array.append(i)</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;        temp_array = list(reversed(temp_array))</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;        <span class="keywordflow">while</span> len(temp_array):</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;            del self[temp_array[0]]</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;            del temp_array[0]</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160; </div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160; </div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html">   83</a></span>&#160;<span class="keyword">class </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html">SqlCacheManage</a>(object):</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    <span class="stringliteral">&quot;&quot;&quot;</span></div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;<span class="stringliteral">    缓存管理</span></div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="stringliteral"></span> </div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;<span class="stringliteral">    1.当内存满足系统运行内存的1/10时,满足最大限度数据内容,保证数据完整性的同时保留数据</span></div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;<span class="stringliteral"></span> </div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;<span class="stringliteral">    2.当单次查询数据大于阈值时,保留数据并不在扩大缓存空间,数据完整保留,但不再清理,直到处于第二缓存空间更多查询数据量再次大于阈值时清理</span></div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;<span class="stringliteral"></span> </div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;<span class="stringliteral">    3.当通过aestate改变数据时记录数据变更信息,并重新将数据写入缓存,移除旧缓存数据,这将意味着非通过aestate修改的数据不可被检测到</span></div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;<span class="stringliteral"></span> </div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;<span class="stringliteral">    4.扩容策略:当前内存&gt;=当前容量1/2时,重新计算查询数据量</span></div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;<span class="stringliteral"></span> </div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;<span class="stringliteral">    5.流量计算方式:当前缓存大小 + (当前缓存大小 / 上次扩容时间至当前时间段内插入的新内容数量) ** 2</span></div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;<span class="stringliteral"></span> </div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;<span class="stringliteral">    6.移除方案:时间段内缓存查询次数最少内存最大优先,当 (A次数-B次数) * 10 &lt;= (A占用内存-B占用内存),优先删除B</span></div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;<span class="stringliteral">    &quot;&quot;&quot;</span></div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    <span class="comment"># 初始内存大小为1024Byte</span></div>
<div class="line"><a name="l00100"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a2261ddadc852c49072190a7a6931459b">  100</a></span>&#160;    __capacity_max__ = 1024</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <span class="comment"># 系统运行时计算得到的内存阈值</span></div>
<div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#acf0cc656e3222c0d130706077945b02a">  102</a></span>&#160;    __max__ = psutil.virtual_memory().free / 10</div>
<div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#af8f7c1929790a3c1a5b76bb2d5669902">  103</a></span>&#160;    _instance_lock = threading.RLock()</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    <span class="comment"># 容器</span></div>
<div class="line"><a name="l00105"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ad0aace4a42ef174d660c091e4248ce3f">  105</a></span>&#160;    __data_container__ = <a class="code" href="classaestate_1_1work_1_1_cache_1_1_data_container.html">DataContainer</a>()</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <span class="comment"># 缓存的状态</span></div>
<div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#aa840bea46038c0d88a1a3c56fa7c9e9d">  107</a></span>&#160;    status = CacheStatus.OPEN</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160; </div>
<div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a85dcd2f4f1f616d4d11e49395b504bf2">  109</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a85dcd2f4f1f616d4d11e49395b504bf2">__contains__</a>(self, o: str) -&gt; bool:</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;        <span class="stringliteral">&quot;&quot;&quot;判断缓存中是否存在这个sql的查询记录&quot;&quot;&quot;</span></div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;        data = self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a0259939a30151844734fb5cfd609ae29">get_container</a>()</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;        <span class="keywordflow">if</span> len(data) == 0:</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">False</span></div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;        <span class="keywordflow">for</span> item <span class="keywordflow">in</span> data:</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;            <span class="keywordflow">if</span> item.sql == o:</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;                <span class="keywordflow">return</span> <span class="keyword">True</span></div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">False</span></div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160; </div>
<div class="line"><a name="l00119"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ab462b2051b33eab22859196d0e5c1ce2">  119</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ab462b2051b33eab22859196d0e5c1ce2">get_size</a>(self):</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;        <span class="stringliteral">&quot;&quot;&quot;获取当前缓存的大小&quot;&quot;&quot;</span></div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;        <span class="keywordflow">return</span> self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a27712b02b508b25fd9294191c26494a7">get_container_size</a>()</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160; </div>
<div class="line"><a name="l00123"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a5c21bd407465106cca1e5eb0131ef21b">  123</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a5c21bd407465106cca1e5eb0131ef21b">get_max</a>(self):</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;        <span class="keywordflow">return</span> self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#acf0cc656e3222c0d130706077945b02a">__max__</a></div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160; </div>
<div class="line"><a name="l00126"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a5e8d55af9d502c0956ec0f8e12687c0b">  126</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a5e8d55af9d502c0956ec0f8e12687c0b">need_calculate</a>(self):</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;        <span class="stringliteral">&quot;&quot;&quot;是否需要清理缓存&quot;&quot;&quot;</span></div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;        <span class="keywordflow">return</span> self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ae56e982dbb9d96fb843ebabbb467051e">get_capacity_max</a>() / 2 &lt;= self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ab462b2051b33eab22859196d0e5c1ce2">get_size</a>()</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160; </div>
<div class="line"><a name="l00130"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ae792fec222bcbe630de2a5e042f5d0e9">  130</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ae792fec222bcbe630de2a5e042f5d0e9">calculate_ram</a>(self) -&gt; bool:</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;        <span class="stringliteral">&quot;&quot;&quot;扩容&quot;&quot;&quot;</span></div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;        self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a0c4599ae98c014a51b5d762c4eb8df07">reset_max_ram</a>()</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;        <span class="keywordflow">if</span> self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a5e8d55af9d502c0956ec0f8e12687c0b">need_calculate</a>():</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;            target_ram = int(self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ae56e982dbb9d96fb843ebabbb467051e">get_capacity_max</a>() * 2 + self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ab462b2051b33eab22859196d0e5c1ce2">get_size</a>())</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;            <span class="keywordflow">if</span> target_ram &lt; self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a5c21bd407465106cca1e5eb0131ef21b">get_max</a>():</div>
<div class="line"><a name="l00136"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a60429610d644b908a960f49d9f6e8f43">  136</a></span>&#160;                self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a2261ddadc852c49072190a7a6931459b">__capacity_max__</a> = target_ram</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;                <span class="keywordflow">return</span> <span class="keyword">True</span></div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;            <span class="keywordflow">else</span>:</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;                <span class="comment"># 直接等于最大内存,然后清理一下</span></div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;                self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a2261ddadc852c49072190a7a6931459b">__capacity_max__</a> = self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a5c21bd407465106cca1e5eb0131ef21b">get_max</a>()</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;                <span class="comment"># 当前允许的最大内存的20%(缓存的平均值),直到缓存满足</span></div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;                size = math.ceil((self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ae56e982dbb9d96fb843ebabbb467051e">get_capacity_max</a>() * 0.2) / (self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ab462b2051b33eab22859196d0e5c1ce2">get_size</a>() / len(self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a0259939a30151844734fb5cfd609ae29">get_container</a>())))</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;                <span class="keywordflow">if</span> size != 0:</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;                    <span class="keywordflow">while</span> size:</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;                        del self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ad0aace4a42ef174d660c091e4248ce3f">__data_container__</a>[0]</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;                        size -= 1</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;                <span class="keywordflow">return</span> <span class="keyword">True</span></div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;        <span class="keywordflow">else</span>:</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">False</span></div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160; </div>
<div class="line"><a name="l00151"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ae87fcb11c61c5cac83e752000301e7d8">  151</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ae87fcb11c61c5cac83e752000301e7d8">get</a>(self, sql) -&gt; SqlCacheItem:</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;        <span class="stringliteral">&quot;&quot;&quot;获取一条sql&quot;&quot;&quot;</span></div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;        index = self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#afc8c0f1408ecb16c7fdb8eb3e2061fbc">index</a>(sql)</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;        ci = self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a0259939a30151844734fb5cfd609ae29">get_container</a>()[index]</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;        ci.set_using_count()</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;        self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a0be2ff29313ad661b935d886335757f3">sort_data</a>()</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;        <span class="keywordflow">return</span> ci</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160; </div>
<div class="line"><a name="l00159"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a9bb9ef4e9e8279556870ca3ba2cd5684">  159</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a9bb9ef4e9e8279556870ca3ba2cd5684">remove</a>(self, sql):</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;        <span class="stringliteral">&quot;&quot;&quot;移除某个sql的缓存&quot;&quot;&quot;</span></div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;        index = self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#afc8c0f1408ecb16c7fdb8eb3e2061fbc">index</a>(sql)</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;        <span class="keywordflow">if</span> index != -1:</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;            del self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ad0aace4a42ef174d660c091e4248ce3f">__data_container__</a>[index]</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160; </div>
<div class="line"><a name="l00165"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a8612e828b1a6692188ac585a3b939a74">  165</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a8612e828b1a6692188ac585a3b939a74">remove_by_instance</a>(self, tb_name):</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;        <span class="stringliteral">&quot;&quot;&quot;根据instance的表来删除缓存&quot;&quot;&quot;</span></div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;        self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a0259939a30151844734fb5cfd609ae29">get_container</a>().delete(tb_name)</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160; </div>
<div class="line"><a name="l00169"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#acb6bc1ce76a8252743285028f179572c">  169</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#acb6bc1ce76a8252743285028f179572c">clean_up</a>(self):</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;        <span class="stringliteral">&quot;&quot;&quot;清理缓存,不是清除缓存,清理是清理使用次数不多的缓存&quot;&quot;&quot;</span></div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;        <span class="keywordflow">if</span> self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a5e8d55af9d502c0956ec0f8e12687c0b">need_calculate</a>():</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;            <span class="comment"># 先试图扩容</span></div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;            self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ae792fec222bcbe630de2a5e042f5d0e9">calculate_ram</a>()</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160; </div>
<div class="line"><a name="l00175"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a0c4599ae98c014a51b5d762c4eb8df07">  175</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a0c4599ae98c014a51b5d762c4eb8df07">reset_max_ram</a>(self):</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;        <span class="stringliteral">&quot;&quot;&quot;重新计算当前可用的最大缓存&quot;&quot;&quot;</span></div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;        free_ram = psutil.virtual_memory().free</div>
<div class="line"><a name="l00178"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ae5966869ce29f84321aec5fd0d535be6">  178</a></span>&#160;        self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#acf0cc656e3222c0d130706077945b02a">__max__</a> = int(free_ram / 10)</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160; </div>
<div class="line"><a name="l00180"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a0be2ff29313ad661b935d886335757f3">  180</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a0be2ff29313ad661b935d886335757f3">sort_data</a>(self):</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;        <span class="comment"># 重新排序</span></div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;        self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ad0aace4a42ef174d660c091e4248ce3f">__data_container__</a>.sort(key=<span class="keyword">lambda</span> x: x.using_count)</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160; </div>
<div class="line"><a name="l00184"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ab408de499f253c6b90def67a035f7bd3">  184</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ab408de499f253c6b90def67a035f7bd3">set</a>(self, sql, value, instance):</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;        self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ad0aace4a42ef174d660c091e4248ce3f">__data_container__</a>.append(<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html">SqlCacheItem</a>(key=sql, value=value, instance=instance))</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;        <span class="comment"># 判断缓存是否已经满了</span></div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;        self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#acb6bc1ce76a8252743285028f179572c">clean_up</a>()</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;        self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a0be2ff29313ad661b935d886335757f3">sort_data</a>()</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160; </div>
<div class="line"><a name="l00190"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a0259939a30151844734fb5cfd609ae29">  190</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a0259939a30151844734fb5cfd609ae29">get_container</a>(self) -&gt; DataContainer:</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;        <span class="keywordflow">return</span> self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ad0aace4a42ef174d660c091e4248ce3f">__data_container__</a></div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160; </div>
<div class="line"><a name="l00193"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a27712b02b508b25fd9294191c26494a7">  193</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a27712b02b508b25fd9294191c26494a7">get_container_size</a>(self):</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;        <span class="keywordflow">return</span> self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ad0aace4a42ef174d660c091e4248ce3f">__data_container__</a>.__sizeof__()</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160; </div>
<div class="line"><a name="l00196"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ae56e982dbb9d96fb843ebabbb467051e">  196</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ae56e982dbb9d96fb843ebabbb467051e">get_capacity_max</a>(self):</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;        <span class="stringliteral">&quot;&quot;&quot;获取当前内存允许的最大限制&quot;&quot;&quot;</span></div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;        <span class="keywordflow">return</span> self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a2261ddadc852c49072190a7a6931459b">__capacity_max__</a></div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160; </div>
<div class="line"><a name="l00200"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a39e6cc283f5c6b29e6107ae9bd0db8a1">  200</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a39e6cc283f5c6b29e6107ae9bd0db8a1">clear</a>(self):</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;        <span class="stringliteral">&quot;&quot;&quot;清空缓存,谨慎操作</span></div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;<span class="stringliteral">        如果仅仅是需要清理缓存空间,请使用clean_up()函数</span></div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;<span class="stringliteral">        &quot;&quot;&quot;</span></div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;        self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ad0aace4a42ef174d660c091e4248ce3f">__data_container__</a>.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a39e6cc283f5c6b29e6107ae9bd0db8a1">clear</a>()</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160; </div>
<div class="line"><a name="l00206"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#afc8c0f1408ecb16c7fdb8eb3e2061fbc">  206</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#afc8c0f1408ecb16c7fdb8eb3e2061fbc">index</a>(self, sql):</div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;        <span class="stringliteral">&quot;&quot;&quot;验证sql是否存在缓存&quot;&quot;&quot;</span></div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;        <span class="keywordflow">for</span> index, item <span class="keywordflow">in</span> enumerate(self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a0259939a30151844734fb5cfd609ae29">get_container</a>()):</div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;            <span class="keywordflow">if</span> item.sql == sql:</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;                <span class="keywordflow">return</span> index</div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;        <span class="keywordflow">return</span> -1</div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160; </div>
<div class="line"><a name="l00213"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#aa109c63a0da563cc95f9922d6a93a9b2">  213</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#aa109c63a0da563cc95f9922d6a93a9b2">__new__</a>(cls, *args, **kwargs):</div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;        <span class="stringliteral">&quot;&quot;&quot;</span></div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;<span class="stringliteral">        单例管理缓存内容</span></div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;<span class="stringliteral">        &quot;&quot;&quot;</span></div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;        instance = Singleton.createObject(cls)</div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;        <span class="keywordflow">return</span> instance</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160; </div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160; </div>
<div class="line"><a name="l00221"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_pojo_container.html">  221</a></span>&#160;<span class="keyword">class </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_pojo_container.html">PojoContainer</a>:</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;    <span class="stringliteral">&quot;&quot;&quot;对象管理器&quot;&quot;&quot;</span></div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160; </div>
<div class="line"><a name="l00224"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_pojo_container.html#a9c6470a0136cea77361ecd9a626d935c">  224</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_pojo_container.html#a9c6470a0136cea77361ecd9a626d935c">__init__</a>(self):</div>
<div class="line"><a name="l00225"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_pojo_container.html#a1aeb54826382adfab9c60666682f5218">  225</a></span>&#160;        self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_pojo_container.html#a1aeb54826382adfab9c60666682f5218">solvent</a> = []</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160; </div>
<div class="line"><a name="l00227"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_pojo_container.html#a2c5e4d022f4ef95001f8ebd4d4c4ee9b">  227</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_pojo_container.html#a2c5e4d022f4ef95001f8ebd4d4c4ee9b">__add__</a>(self, __object):</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;        self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_pojo_container.html#a1aeb54826382adfab9c60666682f5218">solvent</a>.append(__object)</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160; </div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;    @property</div>
<div class="line"><a name="l00231"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_pojo_container.html#aca55d17feecb8c92a1a802da33fe6623">  231</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_pojo_container.html#aca55d17feecb8c92a1a802da33fe6623">size</a>(self) -&gt; int:</div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;        <span class="keywordflow">return</span> len(self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_pojo_container.html#a1aeb54826382adfab9c60666682f5218">solvent</a>)</div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160; </div>
<div class="line"><a name="l00234"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_pojo_container.html#a119f8036521c47ca7c9f801a9d60255d">  234</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_pojo_container.html#a119f8036521c47ca7c9f801a9d60255d">get</a>(self, name):</div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;        <span class="keywordflow">for</span> item <span class="keywordflow">in</span> self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_pojo_container.html#a1aeb54826382adfab9c60666682f5218">solvent</a>:</div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;            <span class="keywordflow">if</span> item._type == name:</div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;                <span class="keywordflow">return</span> item._object</div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;        <span class="keywordflow">return</span> <span class="keywordtype">None</span></div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160; </div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160; </div>
<div class="line"><a name="l00241"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_pojo_item_cache.html">  241</a></span>&#160;<span class="keyword">class </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_pojo_item_cache.html">PojoItemCache</a>(<a class="code" href="namespaceaestate_1_1ajson_1_1sim.html#a336b0c0f6b3ac3ef032027178f2fbfac">OrderedDict</a>):</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;    <span class="stringliteral">&quot;&quot;&quot;单个对象的容器&quot;&quot;&quot;</span></div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160; </div>
<div class="line"><a name="l00244"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_pojo_item_cache.html#a24f3ded3a9e413e3c1e1bd3eea19171c">  244</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_pojo_item_cache.html#a24f3ded3a9e413e3c1e1bd3eea19171c">__init__</a>(self, _type, _object):</div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;        super(PojoItemCache).<a class="code" href="classaestate_1_1work_1_1_cache_1_1_pojo_item_cache.html#a24f3ded3a9e413e3c1e1bd3eea19171c">__init__</a>()</div>
<div class="line"><a name="l00246"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_pojo_item_cache.html#a248f7ed5e1cc3c3aacca7ca78d5d15a2">  246</a></span>&#160;        self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_pojo_item_cache.html#a248f7ed5e1cc3c3aacca7ca78d5d15a2">_type</a> = _type</div>
<div class="line"><a name="l00247"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_pojo_item_cache.html#aee489d281305247f71ba2e017d8119cf">  247</a></span>&#160;        self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_pojo_item_cache.html#aee489d281305247f71ba2e017d8119cf">_object</a> = _object</div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160; </div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160; </div>
<div class="line"><a name="l00250"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_pojo_manage.html">  250</a></span>&#160;<span class="keyword">class </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_pojo_manage.html">PojoManage</a>:</div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;    <span class="stringliteral">&quot;&quot;&quot;管理pojo的缓存&quot;&quot;&quot;</span></div>
<div class="line"><a name="l00252"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_pojo_manage.html#a0f8848d4db5c2572b8878d2061781e37">  252</a></span>&#160;    _instance_lock = threading.RLock()</div>
<div class="line"><a name="l00253"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_pojo_manage.html#a5fafe4f8ce3dd6aeaf0d76bc27ddcc8e">  253</a></span>&#160;    pojo_list = <a class="code" href="classaestate_1_1work_1_1_cache_1_1_pojo_container.html">PojoContainer</a>()</div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160; </div>
<div class="line"><a name="l00255"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_pojo_manage.html#a13b5b55d8079d91db82f88727226c807">  255</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_pojo_manage.html#a13b5b55d8079d91db82f88727226c807">append</a>(self, _cls_name: type, _object):</div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;        self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_pojo_manage.html#a5fafe4f8ce3dd6aeaf0d76bc27ddcc8e">pojo_list</a> + <a class="code" href="classaestate_1_1work_1_1_cache_1_1_pojo_item_cache.html">PojoItemCache</a>(_type=_cls_name, _object=_object)</div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160; </div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;    @staticmethod</div>
<div class="line"><a name="l00259"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_pojo_manage.html#a20b7e323f129ac13ba012d79e220c68d">  259</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_pojo_manage.html#a20b7e323f129ac13ba012d79e220c68d">get</a>(_cls, *args, **kwargs):</div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;        this = <a class="code" href="classaestate_1_1work_1_1_cache_1_1_pojo_manage.html">PojoManage</a>()</div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;        _class_object_ = object.__new__(_cls)</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;        cls_name = others.fullname(_class_object_)</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;        _obj = this.pojo_list.get(cls_name)</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;        <span class="keywordflow">if</span> _obj <span class="keywordflow">is</span> <span class="keywordtype">None</span>:</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;            this.append(cls_name, _class_object_)</div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;            _obj = this.pojo_list.get(cls_name)</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;        [setattr(_obj, k, v) <span class="keywordflow">for</span> k, v <span class="keywordflow">in</span> kwargs.items()]</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;        <span class="keywordflow">return</span> _obj</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160; </div>
<div class="line"><a name="l00270"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_pojo_manage.html#a22a033d26cb99886e5569508d3c8ae04">  270</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_pojo_manage.html#a22a033d26cb99886e5569508d3c8ae04">__new__</a>(cls, *args, **kwargs):</div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;        instance = Singleton.createObject(cls)</div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;        <span class="keywordflow">return</span> instance</div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160; </div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160; </div>
<div class="line"><a name="l00275"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_log_cache.html">  275</a></span>&#160;<span class="keyword">class </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_log_cache.html">LogCache</a>:</div>
<div class="line"><a name="l00276"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_log_cache.html#a36bd9685a79e5fe7551974e4e2eee7ec">  276</a></span>&#160;    _instance_lock = threading.RLock()</div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;    <span class="comment"># 是否已经显示logo了</span></div>
<div class="line"><a name="l00278"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_log_cache.html#a78010abd00cc782a832251ff584acf4f">  278</a></span>&#160;    info_logo_show = <span class="keyword">False</span></div>
<div class="line"><a name="l00279"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_log_cache.html#ae06a573348ce4715289eae288661ed21">  279</a></span>&#160;    warn_logo_show = <span class="keyword">False</span></div>
<div class="line"><a name="l00280"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_log_cache.html#ac4cdf31f7c89cee223141dcf68ba06da">  280</a></span>&#160;    error_logo_show = <span class="keyword">False</span></div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;    <span class="comment"># 文件名,当满足最大时将会使用一个新的文件作为储存日志</span></div>
<div class="line"><a name="l00282"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_log_cache.html#aa126be0072ca3a03d50b3123af326a15">  282</a></span>&#160;    info_file_name = []</div>
<div class="line"><a name="l00283"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_log_cache.html#aff99a06b2ed86121fc55a6f5718bbe5a">  283</a></span>&#160;    warn_file_name = []</div>
<div class="line"><a name="l00284"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_log_cache.html#af47dbcde9d16441d6b4fd8b92217900e">  284</a></span>&#160;    error_file_name = []</div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160; </div>
<div class="line"><a name="l00286"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_log_cache.html#af409eec8386586bd3b888f7cd347d93b">  286</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_log_cache.html#af409eec8386586bd3b888f7cd347d93b">get_filename</a>(self, path, max_clear, status):</div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160; </div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;        <span class="keywordflow">if</span> status == LogStatus.Info:</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;            center_name = <span class="stringliteral">&#39;info&#39;</span></div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;            oa = self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_log_cache.html#aa126be0072ca3a03d50b3123af326a15">info_file_name</a></div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;            logo_show = <span class="stringliteral">&#39;info_logo_show&#39;</span></div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;        <span class="keywordflow">elif</span> status == LogStatus.Error:</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;            center_name = <span class="stringliteral">&#39;error&#39;</span></div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;            oa = self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_log_cache.html#aff99a06b2ed86121fc55a6f5718bbe5a">warn_file_name</a></div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;            logo_show = <span class="stringliteral">&#39;error_logo_show&#39;</span></div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;        <span class="keywordflow">elif</span> status == LogStatus.Warn:</div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;            center_name = <span class="stringliteral">&#39;warn&#39;</span></div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;            oa = self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_log_cache.html#af47dbcde9d16441d6b4fd8b92217900e">error_file_name</a></div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;            logo_show = <span class="stringliteral">&#39;warn_logo_show&#39;</span></div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;        <span class="keywordflow">else</span>:</div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;            center_name = <span class="stringliteral">&#39;info&#39;</span></div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;            oa = self.<a class="code" href="classaestate_1_1work_1_1_cache_1_1_log_cache.html#aa126be0072ca3a03d50b3123af326a15">info_file_name</a></div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;            logo_show = <span class="stringliteral">&#39;info_logo_show&#39;</span></div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160; </div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;        _path = os.path.join(path, center_name)</div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;        <span class="keywordflow">if</span> len(oa) == 0:</div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;            oa.append(others.date_format(fmt=<span class="stringliteral">&#39;%Y.%m.%d.%H.%M.%S&#39;</span>) + <span class="stringliteral">&#39;.log&#39;</span>)</div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;            setattr(self, logo_show, <span class="keyword">False</span>)</div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;        <span class="keywordflow">else</span>:</div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;            <span class="keywordflow">if</span> <span class="keywordflow">not</span> os.path.exists(os.path.join(_path, oa[len(oa) - 1])):</div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;                <a class="code" href="namespaceaestate_1_1util_1_1others.html#a94720f3965606231d30e1a50b0b0112b">write</a>(os.path.join(_path, <span class="stringliteral">&#39;.temp&#39;</span>), <span class="stringliteral">&#39;&#39;</span>)</div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;                setattr(self, logo_show, <span class="keyword">False</span>)</div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;            <span class="keywordflow">if</span> os.path.getsize(os.path.join(_path, oa[len(oa) - 1])) &gt;= max_clear:</div>
<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;                oa.append(others.date_format(fmt=<span class="stringliteral">&#39;%Y.%m.%d.%H.%M.%S&#39;</span>) + <span class="stringliteral">&#39;.log&#39;</span>)</div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;                setattr(self, logo_show, <span class="keyword">False</span>)</div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160; </div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;        <span class="keywordflow">return</span> os.path.join(center_name, oa[len(oa) - 1])</div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160; </div>
<div class="line"><a name="l00319"></a><span class="lineno"><a class="line" href="classaestate_1_1work_1_1_cache_1_1_log_cache.html#a9270d399d0e6eba8ff09c1682a2d162a">  319</a></span>&#160;    <span class="keyword">def </span><a class="code" href="classaestate_1_1work_1_1_cache_1_1_log_cache.html#a9270d399d0e6eba8ff09c1682a2d162a">__new__</a>(cls, *args, **kwargs):</div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;        instance = Singleton.createObject(cls)</div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;        <span class="keywordflow">return</span> instance</div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_manage_html_a9bb9ef4e9e8279556870ca3ba2cd5684"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a9bb9ef4e9e8279556870ca3ba2cd5684">aestate.work.Cache.SqlCacheManage.remove</a></div><div class="ttdeci">def remove(self, sql)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00159">Cache.py:159</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_pojo_container_html"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_pojo_container.html">aestate.work.Cache.PojoContainer</a></div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00221">Cache.py:221</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_manage_html_a2261ddadc852c49072190a7a6931459b"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a2261ddadc852c49072190a7a6931459b">aestate.work.Cache.SqlCacheManage.__capacity_max__</a></div><div class="ttdeci">int __capacity_max__</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00100">Cache.py:100</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_item_html_acd5325286ebd500b0d76755ca6d49da0"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#acd5325286ebd500b0d76755ca6d49da0">aestate.work.Cache.SqlCacheItem.sql</a></div><div class="ttdeci">sql</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00036">Cache.py:36</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_item_html_a3005829b325cf3817b9e77188df7cd5c"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a3005829b325cf3817b9e77188df7cd5c">aestate.work.Cache.SqlCacheItem.get_value</a></div><div class="ttdeci">def get_value(self)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00058">Cache.py:58</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_manage_html_ae56e982dbb9d96fb843ebabbb467051e"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ae56e982dbb9d96fb843ebabbb467051e">aestate.work.Cache.SqlCacheManage.get_capacity_max</a></div><div class="ttdeci">def get_capacity_max(self)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00196">Cache.py:196</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_log_cache_html"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_log_cache.html">aestate.work.Cache.LogCache</a></div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00275">Cache.py:275</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_log_cache_html_aff99a06b2ed86121fc55a6f5718bbe5a"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_log_cache.html#aff99a06b2ed86121fc55a6f5718bbe5a">aestate.work.Cache.LogCache.warn_file_name</a></div><div class="ttdeci">list warn_file_name</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00283">Cache.py:283</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_log_cache_html_aa126be0072ca3a03d50b3123af326a15"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_log_cache.html#aa126be0072ca3a03d50b3123af326a15">aestate.work.Cache.LogCache.info_file_name</a></div><div class="ttdeci">list info_file_name</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00282">Cache.py:282</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_pojo_container_html_a1aeb54826382adfab9c60666682f5218"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_pojo_container.html#a1aeb54826382adfab9c60666682f5218">aestate.work.Cache.PojoContainer.solvent</a></div><div class="ttdeci">solvent</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00225">Cache.py:225</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_pojo_manage_html"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_pojo_manage.html">aestate.work.Cache.PojoManage</a></div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00250">Cache.py:250</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_pojo_container_html_aca55d17feecb8c92a1a802da33fe6623"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_pojo_container.html#aca55d17feecb8c92a1a802da33fe6623">aestate.work.Cache.PojoContainer.size</a></div><div class="ttdeci">int size(self)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00231">Cache.py:231</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_item_html_a31329fa5d5f09dff8780705b10722f53"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a31329fa5d5f09dff8780705b10722f53">aestate.work.Cache.SqlCacheItem.using_count</a></div><div class="ttdeci">using_count</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00041">Cache.py:41</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_manage_html_ae87fcb11c61c5cac83e752000301e7d8"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ae87fcb11c61c5cac83e752000301e7d8">aestate.work.Cache.SqlCacheManage.get</a></div><div class="ttdeci">SqlCacheItem get(self, sql)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00151">Cache.py:151</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_cache_status_html"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_cache_status.html">aestate.work.Cache.CacheStatus</a></div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00023">Cache.py:23</a></div></div>
<div class="ttc" id="anamespaceaestate_1_1util_1_1others_html"><div class="ttname"><a href="namespaceaestate_1_1util_1_1others.html">aestate.util.others</a></div><div class="ttdef"><b>Definition:</b> <a href="others_8py_source.html#l00001">others.py:1</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_data_container_html_ade9b9ec835a75364f390c838b0f2df32"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_data_container.html#ade9b9ec835a75364f390c838b0f2df32">aestate.work.Cache.DataContainer.delete</a></div><div class="ttdeci">def delete(self, tb_name)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00070">Cache.py:70</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_manage_html_a0be2ff29313ad661b935d886335757f3"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a0be2ff29313ad661b935d886335757f3">aestate.work.Cache.SqlCacheManage.sort_data</a></div><div class="ttdeci">def sort_data(self)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00180">Cache.py:180</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_manage_html_a5e8d55af9d502c0956ec0f8e12687c0b"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a5e8d55af9d502c0956ec0f8e12687c0b">aestate.work.Cache.SqlCacheManage.need_calculate</a></div><div class="ttdeci">def need_calculate(self)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00126">Cache.py:126</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_pojo_manage_html_a13b5b55d8079d91db82f88727226c807"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_pojo_manage.html#a13b5b55d8079d91db82f88727226c807">aestate.work.Cache.PojoManage.append</a></div><div class="ttdeci">def append(self, type _cls_name, _object)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00255">Cache.py:255</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_log_cache_html_af47dbcde9d16441d6b4fd8b92217900e"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_log_cache.html#af47dbcde9d16441d6b4fd8b92217900e">aestate.work.Cache.LogCache.error_file_name</a></div><div class="ttdeci">list error_file_name</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00284">Cache.py:284</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_log_cache_html_af409eec8386586bd3b888f7cd347d93b"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_log_cache.html#af409eec8386586bd3b888f7cd347d93b">aestate.work.Cache.LogCache.get_filename</a></div><div class="ttdeci">def get_filename(self, path, max_clear, status)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00286">Cache.py:286</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_manage_html_ab462b2051b33eab22859196d0e5c1ce2"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ab462b2051b33eab22859196d0e5c1ce2">aestate.work.Cache.SqlCacheManage.get_size</a></div><div class="ttdeci">def get_size(self)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00119">Cache.py:119</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_manage_html_aa109c63a0da563cc95f9922d6a93a9b2"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#aa109c63a0da563cc95f9922d6a93a9b2">aestate.work.Cache.SqlCacheManage.__new__</a></div><div class="ttdeci">def __new__(cls, *args, **kwargs)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00213">Cache.py:213</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_item_html_a91cb519f7b12df4536efca91b6d565f2"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a91cb519f7b12df4536efca91b6d565f2">aestate.work.Cache.SqlCacheItem.instance</a></div><div class="ttdeci">instance</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00039">Cache.py:39</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_manage_html_acf0cc656e3222c0d130706077945b02a"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#acf0cc656e3222c0d130706077945b02a">aestate.work.Cache.SqlCacheManage.__max__</a></div><div class="ttdeci">int __max__</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00102">Cache.py:102</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_manage_html_acb6bc1ce76a8252743285028f179572c"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#acb6bc1ce76a8252743285028f179572c">aestate.work.Cache.SqlCacheManage.clean_up</a></div><div class="ttdeci">def clean_up(self)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00169">Cache.py:169</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_data_container_html"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_data_container.html">aestate.work.Cache.DataContainer</a></div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00062">Cache.py:62</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_manage_html_a27712b02b508b25fd9294191c26494a7"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a27712b02b508b25fd9294191c26494a7">aestate.work.Cache.SqlCacheManage.get_container_size</a></div><div class="ttdeci">def get_container_size(self)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00193">Cache.py:193</a></div></div>
<div class="ttc" id="anamespaceaestate_1_1ajson_1_1sim_html_a336b0c0f6b3ac3ef032027178f2fbfac"><div class="ttname"><a href="namespaceaestate_1_1ajson_1_1sim.html#a336b0c0f6b3ac3ef032027178f2fbfac">aestate.ajson.sim.OrderedDict</a></div><div class="ttdeci">def OrderedDict</div><div class="ttdef"><b>Definition:</b> <a href="ajson_2sim_2____init_____8py_source.html#l00026">__init__.py:26</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_manage_html_a39e6cc283f5c6b29e6107ae9bd0db8a1"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a39e6cc283f5c6b29e6107ae9bd0db8a1">aestate.work.Cache.SqlCacheManage.clear</a></div><div class="ttdeci">def clear(self)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00200">Cache.py:200</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_item_html_a2c6fb792c720aa8d6514fdc851059c03"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a2c6fb792c720aa8d6514fdc851059c03">aestate.work.Cache.SqlCacheItem.__init__</a></div><div class="ttdeci">def __init__(self, key, value, instance)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00034">Cache.py:34</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_manage_html_ae792fec222bcbe630de2a5e042f5d0e9"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ae792fec222bcbe630de2a5e042f5d0e9">aestate.work.Cache.SqlCacheManage.calculate_ram</a></div><div class="ttdeci">bool calculate_ram(self)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00130">Cache.py:130</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_manage_html_ad0aace4a42ef174d660c091e4248ce3f"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ad0aace4a42ef174d660c091e4248ce3f">aestate.work.Cache.SqlCacheManage.__data_container__</a></div><div class="ttdeci">__data_container__</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00105">Cache.py:105</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_pojo_item_cache_html_aee489d281305247f71ba2e017d8119cf"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_pojo_item_cache.html#aee489d281305247f71ba2e017d8119cf">aestate.work.Cache.PojoItemCache._object</a></div><div class="ttdeci">_object</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00247">Cache.py:247</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_pojo_manage_html_a22a033d26cb99886e5569508d3c8ae04"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_pojo_manage.html#a22a033d26cb99886e5569508d3c8ae04">aestate.work.Cache.PojoManage.__new__</a></div><div class="ttdeci">def __new__(cls, *args, **kwargs)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00270">Cache.py:270</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_item_html_a75156126f63060127a15dd207bd9e42b"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a75156126f63060127a15dd207bd9e42b">aestate.work.Cache.SqlCacheItem.create_time</a></div><div class="ttdeci">create_time</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00043">Cache.py:43</a></div></div>
<div class="ttc" id="anamespaceaestate_1_1util_html"><div class="ttname"><a href="namespaceaestate_1_1util.html">aestate.util</a></div><div class="ttdef"><b>Definition:</b> <a href="util_2____init_____8py_source.html#l00001">__init__.py:1</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_data_container_html_aa50fe7a984158c7b7102a0085bd2794a"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_data_container.html#aa50fe7a984158c7b7102a0085bd2794a">aestate.work.Cache.DataContainer.data_dict</a></div><div class="ttdeci">data_dict</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00065">Cache.py:65</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_manage_html_a85dcd2f4f1f616d4d11e49395b504bf2"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a85dcd2f4f1f616d4d11e49395b504bf2">aestate.work.Cache.SqlCacheManage.__contains__</a></div><div class="ttdeci">bool __contains__(self, str o)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00109">Cache.py:109</a></div></div>
<div class="ttc" id="anamespaceaestate_1_1work_1_1_modes_html"><div class="ttname"><a href="namespaceaestate_1_1work_1_1_modes.html">aestate.work.Modes</a></div><div class="ttdef"><b>Definition:</b> <a href="_modes_8py_source.html#l00001">Modes.py:1</a></div></div>
<div class="ttc" id="anamespaceaestate_1_1exception_html"><div class="ttname"><a href="namespaceaestate_1_1exception.html">aestate.exception</a></div><div class="ttdef"><b>Definition:</b> <a href="exception_2____init_____8py_source.html#l00001">__init__.py:1</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_pojo_manage_html_a20b7e323f129ac13ba012d79e220c68d"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_pojo_manage.html#a20b7e323f129ac13ba012d79e220c68d">aestate.work.Cache.PojoManage.get</a></div><div class="ttdeci">def get(_cls, *args, **kwargs)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00259">Cache.py:259</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_manage_html_a5c21bd407465106cca1e5eb0131ef21b"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a5c21bd407465106cca1e5eb0131ef21b">aestate.work.Cache.SqlCacheManage.get_max</a></div><div class="ttdeci">def get_max(self)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00123">Cache.py:123</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_manage_html_a8612e828b1a6692188ac585a3b939a74"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a8612e828b1a6692188ac585a3b939a74">aestate.work.Cache.SqlCacheManage.remove_by_instance</a></div><div class="ttdeci">def remove_by_instance(self, tb_name)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00165">Cache.py:165</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_manage_html_a0259939a30151844734fb5cfd609ae29"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a0259939a30151844734fb5cfd609ae29">aestate.work.Cache.SqlCacheManage.get_container</a></div><div class="ttdeci">DataContainer get_container(self)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00190">Cache.py:190</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_data_container_html_a15cb8f5eb2bacb4ca779ebec72bf4997"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_data_container.html#a15cb8f5eb2bacb4ca779ebec72bf4997">aestate.work.Cache.DataContainer.__init__</a></div><div class="ttdeci">def __init__(self)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00063">Cache.py:63</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_item_html_a708bfff78dc5c694bd280406b035dc83"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a708bfff78dc5c694bd280406b035dc83">aestate.work.Cache.SqlCacheItem.get_sql</a></div><div class="ttdeci">def get_sql(self)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00055">Cache.py:55</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_manage_html_ab408de499f253c6b90def67a035f7bd3"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#ab408de499f253c6b90def67a035f7bd3">aestate.work.Cache.SqlCacheManage.set</a></div><div class="ttdeci">def set(self, sql, value, instance)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00184">Cache.py:184</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_pojo_container_html_a119f8036521c47ca7c9f801a9d60255d"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_pojo_container.html#a119f8036521c47ca7c9f801a9d60255d">aestate.work.Cache.PojoContainer.get</a></div><div class="ttdeci">def get(self, name)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00234">Cache.py:234</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_item_html_a8dd56f8f9eed40096c364f764439cf4f"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a8dd56f8f9eed40096c364f764439cf4f">aestate.work.Cache.SqlCacheItem.last_using_time</a></div><div class="ttdeci">last_using_time</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00044">Cache.py:44</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_item_html"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html">aestate.work.Cache.SqlCacheItem</a></div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00031">Cache.py:31</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_pojo_item_cache_html"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_pojo_item_cache.html">aestate.work.Cache.PojoItemCache</a></div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00241">Cache.py:241</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_pojo_container_html_a9c6470a0136cea77361ecd9a626d935c"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_pojo_container.html#a9c6470a0136cea77361ecd9a626d935c">aestate.work.Cache.PojoContainer.__init__</a></div><div class="ttdeci">def __init__(self)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00224">Cache.py:224</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_manage_html_a0c4599ae98c014a51b5d762c4eb8df07"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#a0c4599ae98c014a51b5d762c4eb8df07">aestate.work.Cache.SqlCacheManage.reset_max_ram</a></div><div class="ttdeci">def reset_max_ram(self)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00175">Cache.py:175</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_item_html_adf51da4c5530916e92836fae2d3a411f"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#adf51da4c5530916e92836fae2d3a411f">aestate.work.Cache.SqlCacheItem.set_using_count</a></div><div class="ttdeci">def set_using_count(self)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00052">Cache.py:52</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_pojo_manage_html_a5fafe4f8ce3dd6aeaf0d76bc27ddcc8e"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_pojo_manage.html#a5fafe4f8ce3dd6aeaf0d76bc27ddcc8e">aestate.work.Cache.PojoManage.pojo_list</a></div><div class="ttdeci">pojo_list</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00253">Cache.py:253</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_log_cache_html_a9270d399d0e6eba8ff09c1682a2d162a"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_log_cache.html#a9270d399d0e6eba8ff09c1682a2d162a">aestate.work.Cache.LogCache.__new__</a></div><div class="ttdeci">def __new__(cls, *args, **kwargs)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00319">Cache.py:319</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_manage_html"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html">aestate.work.Cache.SqlCacheManage</a></div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00083">Cache.py:83</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_item_html_ac9f7861a146addf7776e3dd7e9e1a40d"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#ac9f7861a146addf7776e3dd7e9e1a40d">aestate.work.Cache.SqlCacheItem.__setattr__</a></div><div class="ttdeci">def __setattr__(self, key, value)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00047">Cache.py:47</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_item_html_a35298c7944cbf476773dfbd52e4bf5c2"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_item.html#a35298c7944cbf476773dfbd52e4bf5c2">aestate.work.Cache.SqlCacheItem.data</a></div><div class="ttdeci">data</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00038">Cache.py:38</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_sql_cache_manage_html_afc8c0f1408ecb16c7fdb8eb3e2061fbc"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_sql_cache_manage.html#afc8c0f1408ecb16c7fdb8eb3e2061fbc">aestate.work.Cache.SqlCacheManage.index</a></div><div class="ttdeci">def index(self, sql)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00206">Cache.py:206</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_pojo_container_html_a2c5e4d022f4ef95001f8ebd4d4c4ee9b"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_pojo_container.html#a2c5e4d022f4ef95001f8ebd4d4c4ee9b">aestate.work.Cache.PojoContainer.__add__</a></div><div class="ttdeci">def __add__(self, __object)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00227">Cache.py:227</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_data_container_html_a2c9f06012341409fd486408a21a25f07"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_data_container.html#a2c9f06012341409fd486408a21a25f07">aestate.work.Cache.DataContainer.__sizeof__</a></div><div class="ttdeci">def __sizeof__(self)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00067">Cache.py:67</a></div></div>
<div class="ttc" id="anamespaceaestate_1_1util_1_1others_html_a94720f3965606231d30e1a50b0b0112b"><div class="ttname"><a href="namespaceaestate_1_1util_1_1others.html#a94720f3965606231d30e1a50b0b0112b">aestate.util.others.write</a></div><div class="ttdeci">def write(path, *content)</div><div class="ttdef"><b>Definition:</b> <a href="others_8py_source.html#l00082">others.py:82</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_pojo_item_cache_html_a248f7ed5e1cc3c3aacca7ca78d5d15a2"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_pojo_item_cache.html#a248f7ed5e1cc3c3aacca7ca78d5d15a2">aestate.work.Cache.PojoItemCache._type</a></div><div class="ttdeci">_type</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00246">Cache.py:246</a></div></div>
<div class="ttc" id="aclassaestate_1_1work_1_1_cache_1_1_pojo_item_cache_html_a24f3ded3a9e413e3c1e1bd3eea19171c"><div class="ttname"><a href="classaestate_1_1work_1_1_cache_1_1_pojo_item_cache.html#a24f3ded3a9e413e3c1e1bd3eea19171c">aestate.work.Cache.PojoItemCache.__init__</a></div><div class="ttdeci">def __init__(self, _type, _object)</div><div class="ttdef"><b>Definition:</b> <a href="_cache_8py_source.html#l00244">Cache.py:244</a></div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
